package com.test.user.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.test.user.model.UserBean;
import com.test.user.service.UserService;

@Controller
public class UserController {
	@Autowired
	private UserService userService;
	
	@RequestMapping("/getUser")
	public String getUser(){
		ModelAndView model = new ModelAndView();
		List<UserBean> user = userService.getUser();
		
		for (UserBean userBean : user) {
			System.out.println(userBean.getUserName()+"   "+userBean.getPassword());
		}
		model.addObject("list",user);
		return "/test3";
	}
}
